<%
'v4.2.2008
const thisRoomName="Living Room"

const MODE="4.1.1"
<!-- R/W -->
<!-- This variable controls the major HVAC operation of the thermostat.-->
const MODE_OFF="1"
const MODE_HEAT="2"
const MODE_COOL="3"
const MODE_AUTO="4"

const STATE="4.1.2"
<!-- R/O -->
<!-- This object displays the current state of the HVAC system -->
const STATE_INIT="1"
const STATE_OFF="2"
const STATE_HEAT="3"
const STATE_HEAT2="4"
const STATE_HEAT3="5"
const STATE_COOL="6"
const STATE_COOL2="7"
const STATE_DELAY="8"
const STATE_RESETRELAYS="9"

const FAN="4.1.3"
<!-- R/W -->
<!-- This object controls the current fan mode -->
const FAN_AUTO="1"
const FAN_ON="2"
const FAN_SCHEDULE="3"

const FANSTATE="4.1.4"
<!-- R/O -->
<!-- This object displays the current fan state. -->
const FANSTATE_INIT="0"
const FANSTATE_OFF="1"
const FANSTATE_ON="2"

const SETBACKHEAT="4.1.5"
<!-- R/W -->
<!-- 450-950 in Farenheit -->

const SETBACKCOOL="4.1.6"
<!-- R/W -->
<!-- 450-950 in Farenheit -->

const SETBACKHUMIDITY="4.2.22"
<!-- R/W -->
<!-- 0 Disable, 5-95 in % humididty to cool at NT150 only -->
<!-- This object controls the current relative humidity setpoint to activate a cooling cycle -->

const SETBACKSTATUS="4.1.9"
<!-- R/W -->
<!-- This object controls the current setback status.  -->
const SETBACKSTATUS_NORMAL="1"
const SETBACKSTATUS_HOLD="2"
const SETBACKSTATUS_OVERRIDE="3"

const CURRENTPERIOD="4.1.10"
<!-- R/W -->
<!-- This object controls the current period. This object is labeled as R/W, however, there is no provision for the API to set this value and any sets to this variable will be overridden by the thermostats internal logic.   -->
const CURRENTPERIOD_MORN="1"
const CURRENTPERIOD_DAY="2"
const CURRENTPERIOD_EVE="3"
const CURRENTPERIOD_NIGHT="4"

const CURRENTCLASS="4.1.11"
<!-- R/O -->
<!-- This object displays the current day class.  The day class will be changed by the scheduling system at the next schedule boundary. -->
const CURRENTCLASS_IN="1"
const CURRENTCLASS_OUT="2"
const CURRENTCLASS_AWAY="3"


const ACTIVEPERIOD="4.1.12"
<!-- R/O -->
<!-- This object displays the current active period.  This is a combination of the current period and Hold/Override settings.-->
const ACTIVEPERIOD_MORN="1"
const ACTIVEPERIOD_DAY="2"
const ACTIVEPERIOD_EVE="3"
const ACTIVEPERIOD_NIGHT="4"
const ACTIVEPERIOD_HOLD="5"
const ACTIVEPERIOD_OVERRIDE="6"

const ALARM_STATUS_LOW="1.13.2.1"
const ALARM_STATUS_HIGH="1.13.2.2"
const ALARM_STATUS_FILTER="1.13.2.3"
const ALARM_STATUS_HUMIDITY="1.13.2.4"
<!-- R/O -->
<!-- This object displays the current alarm status for each alarm.   -->
const ALARM_STATUS_GREEN="1"
const ALARM_STATUS_YELLOW="2"
const ALARM_STATUS_RED="3"

const SENSOR_CORRECTION_1="4.3.4.2"
const SENSOR_CORRECTION_2="4.3.4.3"
<!-- R/W -->
<!-- This object stores the value (in deci-degrees - no period) that is added to an external sensor to compensate for system properties so that sampled sensor temperature matches actual temperature.   -->
<!-- Integer positive or negative -->

const SENSOR_NAME_1="4.3.5.2"
const SENSOR_NAME_2="4.3.5.3"
<!-- R/W -->
<!-- This object stores the current name of each of the external sensors.   -->

const SENSOR_STATE_LOCAL="4.3.6.1"
const SENSOR_STATE_1="4.3.6.2"
const SENSOR_STATE_2="4.3.6.3"
<!-- R/W -->
<!-- This object controls the current state of sensors.  -->
const SENSOR_NOTPRESENT="0"
const SENSOR_DISABLED="1"
const SENSOR_ENABLED="2"

const SENSOR_AVERAGE_LOCAL="4.3.8.1"
const SENSOR_AVERAGE_1="4.3.8.2"
const SENSOR_AVERAGE_2="4.3.8.3"
<!-- R/W -->
<!-- This object controls whether a sensor is included into the zone average  -->
const SENSOR_AVERAGE_DISABLED="1"
const SENSOR_AVERAGE_ENABLED="2"

const SENSOR_TYPE_1="4.3.9.2"
const SENSOR_TYPE_2="4.3.9.3"
<!-- R/W -->
<!-- This object controls the type of remote sensor  -->
const ANALOG_SENSOR="1"
const THERMISTOR_SENSOR="2"

const AVERGAE_TEMP="4.1.13"
<!-- R/O -->
<!--This object stores the current averaged temperature (Zone Temperature) in deci-degrees of all sensors selected for averaging. -->
<!-- Range is -300 to 2000 [ -30.0 to 200.0 Farenheit -->

const SENSOR_TEMP_LOCAL="4.3.2.1"
const SENSOR_TEMP_1="4.3.2.2"
const SENSOR_TEMP_2="4.3.2.3"
<!-- R/O -->
<!--This object stores the current temperature (Zone Temperature) in deci-degrees of a specific sensor. -->
<!-- Range is -300 to 2000 [ -30.0 to 200.0 Farenheit -->

const RELATIVE_HUMIDITY="4.1.14"
<!-- R/O -->
<!--This object displays the current relative humidity percentage. -->
<!-- Range is 5-95 -->

const SYSTEM_UPTIME="2.1.1"
<!-- R/O -->
<!-- number of seconds since boot -->

const SYSTEM_TIME_SECS="2.5.1"
<!-- R/O -->
<!-- This variable stores the current time of the device. This value is the number of seconds elapsed since Jan 1, 1970.  Use this object to set the current time.-->

const DEVICE_NAME="1.2"
<!-- R/W -->
<!-- This object stores the current device name. -->

const MODEL_NUMBER="2.7.1"
<!-- R/O -->
<!-- This object stores the current device model number.  NT10/NT20/NT100/NT120/NT150 -->


<!-- The following constants are used to set the start times for the occupied, unoccupied, and away periods.  -->
<!-- R/W -->
<!-- values are in minutes from midnight : 1 to 1439 -->
const PERIOD_START_OCCUPIED_1="4.4.1.3.1.1"
const PERIOD_START_OCCUPIED_2="4.4.1.3.1.2"
const PERIOD_START_OCCUPIED_3="4.4.1.3.1.3"
const PERIOD_START_OCCUPIED_4="4.4.1.3.1.4"
const PERIOD_START_UNOCCUPIED_1="4.4.1.3.2.1"
const PERIOD_START_UNOCCUPIED_2="4.4.1.3.2.2"
const PERIOD_START_UNOCCUPIED_3="4.4.1.3.2.3"
const PERIOD_START_UNOCCUPIED_4="4.4.1.3.2.4"
const PERIOD_START_OTHER_1="4.4.1.3.3.1"
const PERIOD_START_OTHER_2="4.4.1.3.3.2"
const PERIOD_START_OTHER_3="4.4.1.3.3.3"
const PERIOD_START_OTHER_4="4.4.1.3.3.4"

<!-- The following constants are used to set the heating point for the occupied, unoccupied, and away periods.  -->
<!-- R/W -->
<!-- values are in decidegrees : 450 to 950 -->
const PERIOD_HEAT_OCCUPIED_1="4.4.1.4.1.1"
const PERIOD_HEAT_OCCUPIED_2="4.4.1.4.1.2"
const PERIOD_HEAT_OCCUPIED_3="4.4.1.4.1.3"
const PERIOD_HEAT_OCCUPIED_4="4.4.1.4.1.4"
const PERIOD_HEAT_UNOCCUPIED_1="4.4.1.4.2.1"
const PERIOD_HEAT_UNOCCUPIED_2="4.4.1.4.2.2"
const PERIOD_HEAT_UNOCCUPIED_3="4.4.1.4.2.3"
const PERIOD_HEAT_UNOCCUPIED_4="4.4.1.4.2.4"
const PERIOD_HEAT_OTHER_1="4.4.1.4.3.1"
const PERIOD_HEAT_OTHER_2="4.4.1.4.3.2"
const PERIOD_HEAT_OTHER_3="4.4.1.4.3.3"
const PERIOD_HEAT_OTHER_4="4.4.1.4.3.4"

<!-- The following constants are used to set the cooling point for the occupied, unoccupied, and away periods.  -->
<!-- R/W -->
<!-- values are in decidegrees : 450 to 950 -->
const PERIOD_COOL_OCCUPIED_1="4.4.1.5.1.1"
const PERIOD_COOL_OCCUPIED_2="4.4.1.5.1.2"
const PERIOD_COOL_OCCUPIED_3="4.4.1.5.1.3"
const PERIOD_COOL_OCCUPIED_4="4.4.1.5.1.4"
const PERIOD_COOL_UNOCCUPIED_1="4.4.1.5.2.1"
const PERIOD_COOL_UNOCCUPIED_2="4.4.1.5.2.2"
const PERIOD_COOL_UNOCCUPIED_3="4.4.1.5.2.3"
const PERIOD_COOL_UNOCCUPIED_4="4.4.1.5.2.4"
const PERIOD_COOL_OTHER_1="4.4.1.5.3.1"
const PERIOD_COOL_OTHER_2="4.4.1.5.3.2"
const PERIOD_COOL_OTHER_3="4.4.1.5.3.3"
const PERIOD_COOL_OTHER_4="4.4.1.5.3.4"

const PERIOD_FAN_TIME_OCCUPIED_1="4.4.1.6.1.1"
const PERIOD_FAN_TIME_OCCUPIED_2="4.4.1.6.1.2"
const PERIOD_FAN_TIME_OCCUPIED_3="4.4.1.6.1.3"
const PERIOD_FAN_TIME_OCCUPIED_4="4.4.1.6.1.4"
const PERIOD_FAN_TIME_UNOCCUPIED_1="4.4.1.6.2.1"
const PERIOD_FAN_TIME_UNOCCUPIED_2="4.4.1.6.2.2"
const PERIOD_FAN_TIME_UNOCCUPIED_3="4.4.1.6.2.3"
const PERIOD_FAN_TIME_UNOCCUPIED_4="4.4.1.6.2.4"
const PERIOD_FAN_TIME_OTHER_1="4.4.1.6.3.1"
const PERIOD_FAN_TIME_OTHER_2="4.4.1.6.3.2"
const PERIOD_FAN_TIME_OTHER_3="4.4.1.6.3.3"
const PERIOD_FAN_TIME_OTHER_4="4.4.1.6.3.4"
<!-- R/W -->
<!-- This table object stores the fan on-time for each class / period pair. [NT120/150 only]  -->
const FAN_DISABLED="0"
const FAN_15_MINS="15"
const FAN_30_MINS="30"
const FAN_45_MINS="45"
const FAN_ALWAYS_ON="60"

const DEFAULT_PERIOD_SUNDAY="4.4.3.2.1"
const DEFAULT_PERIOD_MONDAY="4.4.3.2.2"
const DEFAULT_PERIOD_TUESDAY="4.4.3.2.3"
const DEFAULT_PERIOD_WEDNESDAY="4.4.3.2.4"
const DEFAULT_PERIOD_THURSDAY="4.4.3.2.5"
const DEFAULT_PERIOD_FRIDAY="4.4.3.2.6"
const DEFAULT_PERIOD_SATURDAY="4.4.3.2.7"
<!-- R/W -->
<!--This table object stores the default class id for the default week.-->
const DEFAULT_OCCUPIED="1"
const DEFAULT_UNOCCUPIED="2"
const DEFAULT_AWAY="3"


Function GetUptime()
    GetUptime=DateDiff("s", Date(), Now)
End Function

Function GetTime()
    GetTime=DateDiff("s", "1/1/1970", Now)
End Function

%>